﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shablon
{
    static class Program
    {
        static void Main()
        {
            Console.WriteLine(MyAlg.SearchMax<char>(new char[] { 'a', 'b', 'd', 'c' }));
            Console.WriteLine(MyAlg.SearchMax<int>(new int[] { 10, 20, 30, 25 }));
        }
    }

    class MyAlg
    {
        public static Hello SearchMax<Hello>(Hello[] elements) where Hello : IComparable
        {
            Hello result = elements[0];
            for (int i = 1; i < elements.Length; i++)
            {
                if (result.CompareTo(elements[i]) < 0)
                {
                    result = elements[i];
                }
            }
            return result;
        }
    }
}
